# 将预测标签 进行视频播放


from nuscenes.nuscenes import NuScenes
import os
from nuscenes.utils.color_map import get_colormap

# nuscenes 存放路径
nuscenes_data = "E:\\data\\3DpointCloud\\nuscenes\\nuscenes_mini"
nusc = NuScenes(version="v1.0-mini", dataroot=nuscenes_data, verbose=False)

spec_token = "0ab9ec2730894df2b48df70d0d2e84a9"
my_sample_data = nusc.get("sample_data", spec_token)
my_sample = nusc.get("sample", my_sample_data["sample_token"])

my_scene = nusc.get("scene", my_sample["scene_token"])
# print(my_scene)

# my_scene = nusc.scene[0]
# my_folder_of_predictions = "E:\\data\\3DpointCloud\\nuscenes\\nuscenes_mini\\lidarseg\\v1.0-mini"
my_folder_of_predictions = "D:\\resource\\code\\202507\\vis_nusc\\pred\\test"

nusc.render_scene_channel_lidarseg(my_scene['token'], 
                                   'CAM_BACK', 
                                #    filter_lidarseg_labels=[17, 24],
                                   verbose=True, 
                                   imsize=(1280, 720),
                                   lidarseg_preds_folder=my_folder_of_predictions)